﻿@using Combres.Mvc
@model myMvcBlog.Models.PostView
@{
    ViewBag.Title = Model.Post.Name;
}
<div class="post">
    <h2>
        @Html.ActionLink(Model.Post.Name, "View", new { nicename = Model.Post.UrlName })
    </h2>
    <small>@Model.Post.PostedTime</small>
    <div class="entry">
        <p>
            @Html.Raw(Model.Post.Content)
        </p>
    </div>
    <ul class="postmetadata">
        <li class="icon_comment icon_r">
            @Html.ActionLink(Model.Comments.Count() + " 条评论", "View", "Post", new { nicename = Model.Post.UrlName })
        </li>
        <li class="icon_cat"><strong>目录:</strong>
            @foreach (var category in Model.Categories)
            {
                @Html.ActionLink(category.Name, "View", new
                   {
                       controller = "Category",
                       nicename = category.UrlName
                   });

            }
        </li>
        <li class="icon_tag"><strong>标签:</strong>
            @foreach (var tag in Model.Tags)
            {
                @Html.ActionLink(tag.Name + ", ", "View", new { controller = "Tag", nicename = tag.UrlName });
            }
        </li>
    </ul>
    <br />
    @{Html.RenderPartial("_CommentList", Model.Comments.OrderBy(c => c.CommentTime).ToList());}
    @{Html.RenderPartial("_AddComment", Model.AddComment);}
</div>

@section Styles{
    @Url.CombresLink("codeCSS")
}

@section Scripts{
    @Url.CombresLink("codeJS")
    <script type="text/javascript">
        SyntaxHighlighter.all();
    </script>
}
